﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZhongLangDB;

namespace ZHONGLANGWEBUI.ZHONGLANG.USER
{
    public partial class USER_INFO : TT_BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        { 
            if (!IsPostBack)
            {
                SortedList SDList = new SortedList();
                SDList["KEYID"] = CURREMP.USERID;
                DataTable dt = DBPark.proGetDT(SDList, "PROTT_SYS_USERQUERY");
                DataRow dr = dt.Rows[0];
                txtEUSERNAME.Text  = dr["USERNAME"].ToString();
                txtEUSERMIBIO.Text = dr["USERMIBIO"].ToString();
                txtEUSEREMAIL.Text = dr["USEREMAIL"].ToString();
                alinkEPIC.NavigateUrl = dr["USERHEAD"].ToString();
                if (System.IO.File.Exists(MapPath(dr["USERHEAD"].ToString())))
                {    
                    aImgEPIC.Attributes["src"] = dr["USERHEAD"].ToString();
                }
                lblEUSERSTATENAME.Text = dr["USERSTATENAME"].ToString();
                txtEUSERSELFMSG.Text = dr["USERSELFMSG"].ToString();
            }
        }

        protected void btn_Click(object sender, EventArgs e)
        {
            setUserCurrInfo(CURREMP.USERID, txtEUSERNAME.Text, txtEUSERMIBIO.Text, txtEUSEREMAIL.Text,txtEUSERSELFMSG.Text); 
            if (fupEPIC.PostedFile.FileName != "")
            {
                string strPath = alinkEPIC.NavigateUrl;
                fupEPIC.PostedFile.SaveAs(MapPath(strPath)); 
                aImgEPIC.Attributes["src"] = alinkEPIC.NavigateUrl; 
            }
            jsMessage("更新成功！");
        }
    }
}